/**
 * Created by 45865 on 2020/6/2.
 */

function showaddress() {
    // $('input[name="user"]').val("tom");
    // var loginName = $('input[name="user"]').val()
    // console.log(loginName)
    $.ajax({
        url:"/show/address",
        contentType: "application/json",
        //data:loginName,
        dataType:"json",
        type:"post",
        success:function (data) {
            console.log(data)
            showaddresses(data)
        }

    })
}

function showaddresses(jsonObj) {

    var html = ''
    for (var i =0;i < jsonObj.length;i++){
        html += '<div class="aui-flex"><div class="aui-address-edit">删除</div><div class="aui-flex-box"><h3>'
        html += jsonObj[i].receiveName+'&nbsp;&nbsp;&nbsp;'+jsonObj[i].receivePhone+'</h3><p>'
        html+= jsonObj[i].city+jsonObj[i].district+jsonObj[i].address+'</p></div></div>'
    }
    $('div .showaddress').html(html)
}


showaddress()
